
using FriendStar.Code;
using FriendStar.Domain.Entity.VBaseData;
using FriendStar.Domain.IRepository.VBaseData;
using FriendStar.Repository.VBaseData;
using System.Collections.Generic;
using System.Linq;
using SqlSugarRepository;

namespace FriendStar.Application.VBaseData
{
    public class V_ZSJ_B1_GH_SupplierForRegisterApp
    {
        private IV_ZSJ_B1_GH_SupplierForRegisterRepository service = new V_ZSJ_B1_GH_SupplierForRegisterRepository();

        public List<V_ZSJ_B1_GH_SupplierForRegisterEntity> GetList(bool isSupplierProduct)
        {
            var expression = ExtLinq.True<V_ZSJ_B1_GH_SupplierForRegisterEntity>();
            string flag = isSupplierProduct ? "1" : "0";
            string UseUnit = Configs.GetValue("UseUnit");
            expression = expression.And(p => p.IsSupplierProduct == flag);
            expression = expression.And(t => t.UseUnit == UseUnit);
            return service.IQueryable(expression).OrderBy(p=>p.UnitNO).ToList();
        }
    }
}
